#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
传感器配置文件
包含各类传感器的配置参数
"""

import os
from typing import Dict, Any

# 语音传感器配置
VOICE_SENSOR_CONFIG: Dict[str, Any] = {
    "access_key": os.environ.get("PICOVOICE_ACCESS_KEY"),
    "wake_word": "hey siri",
    "vad_aggressiveness": 2,
    "sample_rate": 16000,
    "frame_duration_ms": 30,
    "input_device": "plughw:2,0",
    "max_silence_seconds": 4,
}

# IMU传感器配置
IMU_SENSOR_CONFIG: Dict[str, Any] = {
    "i2c_address": 0x79,  # 使用检测到的地址
    "i2c_bus": 1,
    "sample_rate": 100,
    "calibration_file": "config/imu_calibration.json",
}

# 超声波传感器配置
ULTRASONIC_SENSOR_CONFIG: Dict[str, Any] = {
    "trigger_pin": 23,  # 触发引脚
    "echo_pin": 24,  # 回波引脚
    "sample_rate": 10,
    "timeout": 0.1,  # 超时时间(s)
    "max_distance": 400,  # 最大测量距离(cm)
}

# 视觉传感器配置
CAMERA_SENSOR_CONFIG: Dict[str, Any] = {
    "device_id": 0,  # 摄像头ID
    "width": 640,
    "height": 480,
    "fps": 30,  # 帧率
    "exposure": -6,  # 曝光值
    "gain": 0,
}
